# 设置最低的CMake版本要求
cmake_minimum_required(VERSION 3.27)

# 设置项目名称
project(NetdiskServer C)

set(CMAKE_C_STANDARD 99)

# 设置编译选项
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall")

set(INCLUDE_DIR
        include/constant
        include/entity
        include/l8w8jwt
        include/protocols
        include/utils
        include
)
# 设置头文件目录
include_directories(${INCLUDE_DIR})

# 链接静态库
link_directories(lib)
link_libraries(
        l8w8jwt
        mbedcrypto
        mbedtls
        mbedx509
)

#set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR})
file(GLOB_RECURSE SOURCES src/*.c)
add_executable(NetdiskServer
        ${SOURCES}
)

# 链接动态库
target_link_libraries(NetdiskServer
        pthread
        mysqlclient
)
